package cn.tcmp.controller;

import cn.tcmp.client.DetailClient;
import cn.tcmp.client.SortClient;
import com.alibaba.fastjson.JSON;
import com.sun.org.apache.xpath.internal.operations.Gt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class BbsController {

    @Autowired
    private DetailClient detailClient;
    @Autowired
    private SortClient sortClient;

    @RequestMapping(value = "queryAll", method = RequestMethod.GET)
    public String queryAll(Integer sortId) {
        if (sortId == null) {
            sortId = -1;
        }
        return detailClient.queryAll(sortId);
    }

    @RequestMapping(value = "queryById", method = RequestMethod.GET)
    public String queryById() {
        return sortClient.queryById();
    }

    @RequestMapping(value = "querySort", method = RequestMethod.GET)
    public String querySort() {
        return sortClient.queryById();
    }


}
